lock=0
alltime=180
y_stand={4,4,4,4,4,6,8,8,7,6,6}
function OnEvent(event, arg)
	if(event=="PROFILE_ACTIVATED")then
		EnablePrimaryMouseButtonEvents(true)
	end

	OutputLogMessage("Event: "..event.." Arg: "..arg.." lock: "..lock.."\n")
	if(event=="MOUSE_BUTTON_PRESSED" and arg==4  )then
	        OutputLogMessage("开启\n")
		lock=1
	end
	if(event=="MOUSE_BUTTON_PRESSED" and arg==5  )then
	        OutputLogMessage("关闭\n")
		lock=0
	end
--***********************************************************
--***********************************************************
	if(event=="MOUSE_BUTTON_PRESSED" and arg==1 and lock==1)then
		cx=0
		for i=1,11 do
			while IsMouseButtonPressed(1) do
			MoveMouseRelative(0,y_stand[i])			
			Sleep(10)
			cx=cx+1
			OutputLogMessage("计数器:%d\n",cx)
			end		
		end
	end
end
